home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / Developer Essentials Jul 90 / DTS Sample Code / Macintosh Sample Code / SC.024.SoundApp / SoundApp.r < prev    next >
Encoding:
Text File  |  1990-05-01  |  36.4 KB  |  958 lines  |  [TEXT/MPS ]

  1. /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  2. #
  3. # Apple Macintosh Developer Technical Support
  4. #
  5. # MultiFinder-Aware SoundApp Application
  6. #
  7. # SoundApp
  8. #
  9. # SoundApp.r    -    Rez Source
  10. #
  11. # Jim Reekes - Macintosh Developer Technical Support
  12. # Copyright © 1989-1990 Apple Computer, Inc.
  13. # All rights reserved.
  14. #
  15. # Versions:
  16. #             1.03                    May, 1990
  17. #
  18. # Components:
  19. #             SoundApp.make        May 1, 1990            MPW build script
  20. #             SoundApp.p            May 1, 1990            Pascal source code
  21. #             SoundApp.r            May 1, 1990            Rez source code
  22. #             SoundAppSnds.r        May 1, 1990            Rez source code
  23. #             SoundUnit.p            May 1, 1990            Pascal source code
  24. #
  25. # Formatting was done with FONT = Monaco, SIZE = 9, TABS = 3
  26. #
  27. # SoundApp.p is a sample application source file for demonstrating
  28. # the Sound Manager.  It requires the use of the SoundUnit to handle
  29. # all of the sound routines.  This portion of the source code handles the
  30. # application’s management of memory, errors, user interface, etc..
  31. #
  32. # Jim Reekes E.O., Macintosh Developer Technical Support
  33. # Tuesday, January 30, 1990  1:01 PM
  34. #
  35. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
  36.  
  37. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  38. // INCLUDES
  39. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  40.  
  41. #include "Types.r"
  42. #include "SysTypes.r"
  43.  
  44. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  45. // CONSTANTS
  46. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  47.  
  48. // These #defines are used to set enable/disable flags of a menu
  49. #define AllItems        0b1111111111111111111111111111111    /* 31 bits worth of flags */
  50. #define NoItems        0b0000000000000000000000000000000
  51. #define MenuItem1        0b0000000000000000000000000000001
  52. #define MenuItem2        0b0000000000000000000000000000010
  53. #define MenuItem3        0b0000000000000000000000000000100
  54. #define MenuItem4        0b0000000000000000000000000001000
  55. #define MenuItem5        0b0000000000000000000000000010000
  56. #define MenuItem6        0b0000000000000000000000000100000
  57. #define MenuItem7        0b0000000000000000000000001000000
  58. #define MenuItem8        0b0000000000000000000000010000000
  59. #define MenuItem9        0b0000000000000000000000100000000
  60. #define MenuItem10    0b0000000000000000000001000000000
  61. #define MenuItem11    0b0000000000000000000010000000000
  62. #define MenuItem12    0b0000000000000000000100000000000
  63.  
  64.  
  65. /* These values are used in SIZE resource. */
  66.  
  67. #define kMinSize                150        /*application’s minimum size (in K)*/
  68. #define kPrefSize                300        /*application’s preferred size (in K)*/
  69.  
  70. /* This is the rectangle of where to place the icon in an alert. */
  71.  
  72. #define kStdAlertIconRect    {10, 20, 42, 52}
  73.  
  74. /* These constants are the size of a standard button and the default button.
  75.    In this application, the default button is always placed centered at the
  76.     bottom of the window. */
  77.  
  78. #define kButtonFrameInset    -4        /* inset rectangle adjustment around button */
  79. #define kButtonSizeW            74
  80. #define kButtonSizeH            17
  81. #define kDafaultButSizeW    (74 - kButtonFrameInset - kButtonFrameInset)
  82. #define kDafaultButSizeH    (17 - kButtonFrameInset - kButtonFrameInset)
  83.  
  84. /* These constants are used in defining the size of the application’s windows.
  85.    All of the following windows are dymanically positioned on screen by
  86.     the application.  These values will change the height and width of the windows. */
  87.  
  88. #define kExitAlertSizeH        129
  89. #define kExitAlertSizeW        248
  90. #define kUserAlertSizeH        129
  91. #define kUserAlertSizeW        304
  92. #define kSoundVolSizeH        96
  93. #define kSoundVolSizeW        240
  94. #define kAboutWindowSizeH    232
  95. #define kAboutWindowSizeW    336
  96. #define kStatusWindowSizeH    96
  97. #define kStatusWindowSizeW    240
  98.  
  99. /* Believe it or not, I found this complication to be very useful.
  100.     Normally, people tend to use ResEdit to change the layout of a window
  101.     especially for dialogs.  I have a difficult time getting the pixels
  102.     exactly right using ResEdit.  People said I could then DeRez the window
  103.     and make the adjustments.  This was just a difficult.  I needed some
  104.     scratch paper and a calculator.  After thinking about it, I wrote these
  105.     definitions of my window’s geometry.  This ended up in a scheme that I
  106.     found to be much more helpful in building the exact window I wanted.  The
  107.     document window has all items spaced apart from each a consistent amount.
  108.     The size of the items are consistent and spaced equally apart from each
  109.     other. */
  110.  
  111. #define kSndStdSpacing        8        /* adjusts the relative spacing of the entire window */
  112. #define kSndButtonSizeW        100    /* SizeW of buttons in document window */
  113. #define kSndButtonSizeH        24        /* heigth of buttons in document window */
  114. #define kSndListButGap        (16 + (2 * kSndStdSpacing)) /* list’s scroll bar and more */
  115. #define kSoundWindowSizeH    ((5 * kSndStdSpacing) + (5 * kSndButtonSizeH) + kSndStdSpacing)
  116. #define kSoundWindowSizeW    296
  117.  
  118. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  119. // RESOURCE ID NUMBERS
  120. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  121. // ICON resources from the system’s alert icons
  122. #define rNoteIcon                1            /*the note icon*/
  123. #define rCautionIcon            2            /*the caution icon*/
  124.  
  125. // ALRT resources
  126. #define rExitAlert            1000        /*emergency exit user alert*/
  127. #define rUserAlert            1001        /*error message user alert*/
  128. #define rSoundVol                1002        /*volume too low message*/
  129. #define rSFPGetFileDLOG        -4000        /*custom SFPGetFile dialog*/
  130.  
  131. // application’s BNDL resources
  132. #define rAppBundle            1000        /*application’s bundle resource ID*/
  133. #define rAppSignature         'SAPP'    /*applicaiton’s OS signature*/
  134.  
  135. // ICON resources
  136. #define rMoofIcon                1000
  137.  
  138. // ICN# resources
  139. #define rMoofIconList        1000
  140.  
  141. // CNTL resources
  142. #define rCancelCntl            1000        /*button ID for the status window*/
  143. #define rPlaySndCntl            1001        /*button ID for the document window*/
  144. #define rHyperPlayCntl        1002        /*button ID for the document window*/
  145. #define rPlayScaleCntl        1003        /*button ID for the document window*/
  146. #define rPlayMelodyCntl        1004        /*button ID for the document window*/
  147. #define rStopCntl                1005        /*button ID for the document window*/
  148. #define rAboutOKCntl            1006        /*button ID for the about window*/
  149.  
  150. // CURS resources
  151. #define rSndCursor            1000        /*document cursor ID*/
  152. #define rACursor1                1001        /*animated cursor ID*/
  153. #define rACursor2                1002        /*animated cursor ID*/
  154. #define rACursor3                1003        /*animated cursor ID*/
  155. #define rACursor4                1004        /*animated cursor ID*/
  156.  
  157. // Menu resources.  The following constants have a “m” prefix to notate they’re menus.
  158. #define rMenuBar                1000        /*application’s menu bar*/
  159. #define mApple                    128        /*Apple menu*/
  160. #define mFile                    129        /*File menu*/
  161. #define mEdit                    130        /*Edit menu*/
  162. #define mDemos                    1000        /*Demo menu*/
  163.  
  164. // PICT resources
  165. #define rAppPict                1000        /*picture appearing in about window*/
  166.  
  167. // RECT resources, custom made to order
  168. #define rListRectID            1000        /*size of list rectangle*/
  169.  
  170. // STR resources
  171. #define rUntitled                1000        /*string for untitled snd resources*/
  172. #define rAboutText            1001        /*string for text appearing in about window*/
  173.  
  174. // STR# resources.  The following constants have a “s” prefix to notate they’re strings.
  175. #define sErrStrings            1000        /*error strings STR# ID*/
  176. #define sMessStrings            1001        /*message strings STR# ID for status window*/
  177. #define sSMErrStrings        1002        /*message strings of Sound Manager errors*/
  178.  
  179. // WIND resources.  All windows used in the application need a unique resource ID.
  180. #define rAboutWindow            1000        /*about dialog*/
  181. #define rStatusWindow        1001        /*status window ID used to show current sound*/
  182. #define rSoundWindow            1002        /*sound document window ID*/
  183.  
  184.  
  185. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  186. // RESOURCE TYPES
  187. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  188.  
  189. /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  190.  The animated cursor resource used in the MPW CursorCtl unit is not
  191.  defined by MPW.  So, I’ve created the type for it. */
  192.  
  193. type 'acur' {
  194.     integer = $$Countof(AcursArray);    /*Number of cursors (“frames of film”)*/
  195.     fill word;                                /*Next frame to show <for internal use>*/
  196.     wide array AcursArray {
  197.         integer;                                /*'CURS' resource id for frame #1*/
  198.         fill word;                            /*<for internal use>*/
  199.     };
  200. };
  201.  
  202. /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  203.  This is a definition for a resource which contains only a rectangle */
  204.  
  205. type 'RECT' {
  206.     rect;
  207. };
  208.  
  209. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  210. // RESOURCE DEFINITIONS
  211. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  212.  
  213. /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  214.  This is the vers resource used by the Finder in the Get Info window.
  215.  I also display the short version number in the about window. */
  216.  
  217. resource 'vers' (1, purgeable) {
  218.     0x10, 0x03, final, 0x0, verUs,
  219.     "1.03", "1.03, Copyright © 1989-90 Apple Computer"
  220. };
  221.  
  222. /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  223.  These are the resources used for the animated cursors.  They are preloaded
  224.  and non-purgeable to help reduce memory fragmentation. */
  225.  
  226. resource 'acur' (0, preload, nonPurgeable) {
  227.     {
  228.     rACursor1, rACursor2, rACursor3, rACursor4
  229.     }
  230. };
  231.  
  232. resource 'CURS' (rACursor1, preload, nonPurgeable) {
  233.     $"00 00 00 00 00 00 16 00 3E 01 54 03 C3 05 F3 FD"
  234.     $"08 FA 0C 72 0C 02 0D F2 0A 0A 0A 0A 0A 0A 1C 1E",
  235.     $"00 00 00 00 00 00 16 00 3E 01 7C 03 FF 07 FF FF"
  236.     $"0F FE 0F FE 0F FE 0F FE 0E 0E 0E 0E 0E 0E 1C 1E",
  237.     {4, 10}
  238. };
  239.  
  240. resource 'CURS' (rACursor2, preload, nonPurgeable) {
  241.     $"30 30 28 38 24 24 13 AC 0B C6 04 0C 02 36 02 36"
  242.     $"02 E0 02 E0 0E E0 10 60 26 20 29 90 28 50 30 38",
  243.     $"30 30 38 38 3C 3C 1F BC 0F FE 07 FC 03 F6 03 F6"
  244.     $"03 E0 03 E0 0F E0 1F E0 3F E0 39 F0 38 70 30 38",
  245.     {15, 7}
  246. };
  247.  
  248. resource 'CURS' (rACursor3, preload, nonPurgeable) {
  249.     $"00 00 06 C0 0A A0 12 90 14 58 17 D8 20 18 27 18"
  250.     $"4F 18 9F CF E0 C3 80 2A 00 FC 00 D0",
  251.     $"00 00 06 C0 0E E0 1E F0 1C 78 1F F8 3F F8 3F F8"
  252.     $"7F F8 FF FF E0 FF 80 3E 00 FC 00 D0",
  253.     {9, 6}
  254. };
  255.  
  256. resource 'CURS' (rACursor4, preload, nonPurgeable) {
  257.     $"0E 06 05 0A 04 CA 02 32 03 04 03 B8 03 A0 03 A0"
  258.     $"36 20 36 20 18 10 31 E8 1A E4 12 12 0E 0A 06 06",
  259.     $"0E 06 07 0E 07 CE 03 FE 03 FC 03 F8 03 E0 03 E0"
  260.     $"37 E0 37 E0 1F F0 3F F8 1E FC 1E 1E 0E 0E 06 06",
  261.     {6, 6}
  262. };
  263.  
  264. /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  265.  This is the cursor used when the cursor is over a sound document window. */
  266.  
  267. resource 'CURS' (rSndCursor, preload, nonPurgeable) {
  268.     $"03 80 04 C0 04 C0 04 C0 04 C0 04 C0 74 F8 9C AE"
  269.     $"4C AB 24 0B 24 03 10 03 08 03 08 06 04 06 04 06",
  270.     $"03 80 07 C0 07 C0 07 C0 07 C0 07 C0 77 F8 FF FE"
  271.     $"7F FF 3F FF 3F FF 1F FF 0F FF 0F FE 07 FE 07 FE",
  272.     {0, 7}
  273. };
  274.  
  275. /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  276.  These are the resources used to create the bungle package used by the Finder.
  277.  I use type coerson to create my signature string.  */
  278.  
  279. type rAppSignature as 'STR ';
  280.  
  281. resource rAppSignature (0, purgeable) {
  282.     "SoundApp"
  283. };
  284.  
  285. resource 'BNDL' (rAppBundle, purgeable) {
  286.     rAppSignature, 0,
  287.     {
  288.         'ICN#', {0, rMoofIconList},
  289.         'FREF', {0, rAppBundle}
  290.     }
  291. };
  292.  
  293. resource 'FREF' (rAppBundle, purgeable) {
  294.     'APPL', 0, ""
  295. };
  296.  
  297. resource 'ICN#' (rMoofIconList, purgeable) {
  298.     {
  299. /* [1] */
  300.         $"04 30 40 00 0A 50 A0 00 0B 91 10 02 08 22 08 03"
  301.         $"12 24 04 05 20 28 02 09 40 10 01 11 80 0C 00 A1"
  302.         $"80 03 FF C2 7E 00 FF 04 01 00 7F 04 03 00 1E 08"
  303.         $"04 E0 00 0C 08 E0 00 0A 10 E0 00 09 08 C0 00 06"
  304.         $"04 87 FE 04 02 88 01 04 01 88 00 84 00 88 00 44"
  305.         $"00 88 00 44 00 88 00 C4 01 10 01 88 02 28 03 10"
  306.         $"01 C4 04 E0 00 02 08 00 73 BF FB EE 4C A2 8A 2A"
  307.         $"40 AA AA EA 52 AA AA 24 5E A2 8A EA 73 BE FB 8E",
  308. /* [2] */
  309.         $"04 30 40 00 0E 70 E0 00 0F F1 F0 02 0F E3 F8 03"
  310.         $"1F E7 FC 07 3F EF FE 0F 7F FF FF 1F FF FF FF BF"
  311.         $"FF FF FF FE 7F FF FF FC 01 FF FF FC 03 FF FF F8"
  312.         $"07 FF FF FC 0F FF FF FE 1F FF FF FF 0F FF FF FE"
  313.         $"07 FF FF FC 03 FF FF FC 01 FF FF FC 00 FF FF FC"
  314.         $"00 FF FF FC 00 FF FF FC 01 FF FF F8 03 EF FF F0"
  315.         $"01 C7 FC E0 00 03 F8 00 73 BF FB EE 7F BE FB EE"
  316.         $"7F BE FB EE 7F BE FB E4 7F BE FB EE 73 BE FB 8E"
  317.     }
  318. };
  319.  
  320. /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  321.  These are the resources used for an emergency exit alert. */
  322.  
  323. resource 'ALRT' (rExitAlert, purgeable) {
  324.     {0, 0, kExitAlertSizeH, kExitAlertSizeW}, rExitAlert,
  325.     {
  326. /* [1] */ OK, visible, silent,
  327. /* [2] */ OK, visible, silent,
  328. /* [3] */ OK, visible, silent,
  329. /* [4] */ OK, visible, silent
  330.     }
  331. };
  332.  
  333. resource 'DITL' (rExitAlert, purgeable) {
  334.     {
  335. /* [1] */    {
  336.                 (kExitAlertSizeH - kDafaultButSizeH),                                        /* top */
  337.                  ((kExitAlertSizeW - kDafaultButSizeW) / 2),                                /* left */
  338.                  (kExitAlertSizeH - kDafaultButSizeH + kButtonSizeH),                    /* bottom */
  339.                 (((kExitAlertSizeW - kDafaultButSizeW) / 2) + kDafaultButSizeW)    /* right */
  340.                 },
  341.         Button {
  342.             enabled, "OK"
  343.         },
  344. /* [2] */ kStdAlertIconRect,
  345.         Icon {
  346.             disabled, rCautionIcon
  347.         },
  348. /* [3] */ {8, 72, 40, 240},
  349.         StaticText {
  350.             disabled, "Sorry, an unrecoverable error has occurred!"
  351.         },
  352. /* [4] */ {48, 8, 96, 240},
  353.         StaticText {
  354.             disabled, "^0"
  355.         }
  356.     }
  357. };
  358.  
  359. /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  360.  These are the resources used to display error messages to the user. */
  361.  
  362. resource 'ALRT' (rUserAlert, purgeable) {
  363.     {0, 0, kUserAlertSizeH, kUserAlertSizeW}, rUserAlert,
  364.     {
  365. /* [1] */ OK, visible, silent,
  366. /* [2] */ OK, visible, silent,
  367. /* [3] */ OK, visible, silent,
  368. /* [4] */ OK, visible, silent
  369.     }
  370. };
  371.  
  372. resource 'DITL' (rUserAlert, purgeable) {
  373.     {
  374. /* [1] */    {
  375.                 (kUserAlertSizeH - kDafaultButSizeH),                                        /* top */
  376.                  ((kUserAlertSizeW - kDafaultButSizeW) / 2),                                /* left */
  377.                  (kUserAlertSizeH - kDafaultButSizeH + kButtonSizeH),                    /* bottom */
  378.                 (((kUserAlertSizeW - kDafaultButSizeW) / 2) + kDafaultButSizeW)    /* right */
  379.                 },
  380.         Button {
  381.             enabled, "OK"
  382.         },
  383. /* [2] */ {8, 72, 88, 296},
  384.         StaticText {
  385.             disabled, "^0\n(error = ^1)"
  386.         },
  387. /* [3] */ kStdAlertIconRect,
  388.         Icon {
  389.             disabled, rCautionIcon
  390.         }
  391.     }
  392. };
  393.  
  394. /* These are the strings used for error messages. */
  395. resource 'STR#' (sErrStrings, purgeable) {
  396.     {
  397.     "An error has occurred.";
  398.     "A Memory Manager error has occurred.";
  399.     "A Resource Manager error has occurred.";
  400.     "That file is currently open and cannot be used.";
  401.     "The wave table synthesizer is not available.";
  402.     "This system does not support the Sound Manager; use System 6.0.2 or later.";
  403.     "Memory is too low to continue.  Try closing a window or increasing the SIZE resource.";
  404.     "Could not find application’s menu resources.";
  405.     "Could not initialize the Sound unit.";
  406.     "The Sound Manager has encountered an error.";
  407.     "Could not create a new document.";
  408.     "Error initializing the status window.";
  409.     "This file does not contain any sound resources.";
  410.     }
  411. };
  412.  
  413. /* These are a set of strings used to report Sound Manager errors.  Instead of
  414.  the error number, one of these strings will be used.  These are only the set
  415.  of Sound Manager errors.  The equation to be used to include additional strings
  416.  is the Sound Manager ABS(error) + noHardware) + 1.  200 is the first Sound Manager
  417.  error number and 1 is the index, since GetIndString is 1 based. */
  418.  
  419. resource 'STR#' (sSMErrStrings, purgeable) {
  420.     {
  421.     "no hardware available";                        /* noHardware -200 */
  422.     "not enough hardware available";                /* notEnoughHardware -201 */
  423.     "";                                                    /* not used -202 */
  424.     "sound channel queue is full";                /* queueFull -203 */
  425.     "problem with resource";                        /* resProblem -204 */
  426.     "bad sound channel";                                /* badChannel -205 */
  427.     "bad sound format";                                /* badFormat -206 */
  428.     }
  429. };
  430.  
  431. /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  432.  These are the resources used to tell the user about the sound volume. */
  433.  
  434. resource 'ALRT' (rSoundVol, purgeable) {
  435.     {0, 0, kSoundVolSizeH, kSoundVolSizeW}, rSoundVol,
  436.     {
  437. /* [1] */ OK, visible, sound1,
  438. /* [2] */ OK, visible, sound1,
  439. /* [3] */ OK, visible, sound1,
  440. /* [4] */ OK, visible, sound1
  441.     }
  442. };
  443.  
  444. resource 'DITL' (rSoundVol, purgeable) {
  445.     {
  446. /* [1] */    {
  447.                 (kSoundVolSizeH - kDafaultButSizeH),                                        /* top */
  448.                 ((kSoundVolSizeW - kDafaultButSizeW) / 2),                                /* left */
  449.                 (kSoundVolSizeH - kDafaultButSizeH + kButtonSizeH),                    /* bottom */
  450.                 (((kSoundVolSizeW - kDafaultButSizeW) / 2) + kDafaultButSizeW)        /* right */
  451.                 },
  452.         Button {
  453.             enabled, "OK"
  454.         },
  455. /* [2] */ {8, 72, 56, 232},
  456.         StaticText {
  457.             disabled,
  458.             "The sound volume is ^0.  Use the Control Panel if you wish to adjust this."
  459.         },
  460. /* [3] */ kStdAlertIconRect,
  461.         Icon {
  462.             disabled, rNoteIcon
  463.         }
  464.     }
  465. };
  466.  
  467. /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  468.  These are the resources for my custom Standard File dialog. */
  469.  
  470. resource 'DLOG' (rSFPGetFileDLOG, purgeable) {
  471.     {0, 0, 224, 348},
  472.     dBoxProc, invisible, noGoAway, 0x0, rSFPGetFileDLOG, ""
  473. };
  474.  
  475. resource 'DITL' (rSFPGetFileDLOG, purgeable) {
  476.     {
  477. /* [1] */ {138, 256, 156, 336},
  478.         Button {
  479.             enabled, "Open"
  480.         },
  481. /* [2] */ {1152, 59, 1232, 77},
  482.         Button {
  483.             enabled, ""
  484.         },
  485. /* [3] */ {163, 256, 181, 336},
  486.         Button {
  487.             enabled, "Cancel"
  488.         },
  489. /* [4] */ {39, 232, 59, 347},
  490.         UserItem {
  491.             disabled
  492.         },
  493. /* [5] */ {68, 256, 86, 336},
  494.         Button {
  495.             enabled, "Eject"
  496.         },
  497. /* [6] */ {93, 256, 111, 336},
  498.         Button {
  499.             enabled, "Drive"
  500.         },
  501. /* [7] */ {39, 12, 185, 230},
  502.         UserItem {
  503.             enabled
  504.         },
  505. /* [8] */ {39, 229, 185, 246},
  506.         UserItem {
  507.             enabled
  508.         },
  509. /* [9] */ {124, 252, 125, 340},
  510.         UserItem {
  511.             disabled
  512.         },
  513. /* [10] */ {1044, 20, 1145, 116},
  514.         StaticText {
  515.             disabled, ""
  516.         },
  517. /* [11] */ {192, 16, 216, 288},
  518.         CheckBox {
  519.             enabled, "Show only files with sound resources"
  520.         }
  521.     }
  522. };
  523.  
  524. /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  525.  We use an MBAR resource to conveniently load all the menus */
  526.  
  527. resource 'MBAR' (rMenuBar, preload) {
  528.     {mApple, mFile, mEdit, mDemos};
  529. };
  530.  
  531. resource 'MENU' (mApple, preload) { /* Disable dashed line, enable About and DAs */
  532.     mApple, textMenuProc,
  533.     (AllItems & ~MenuItem2),
  534.     enabled, apple,
  535.     {
  536.         "About SoundApp…",
  537.             noicon, nokey, nomark, plain;
  538.         "-",
  539.             noicon, nokey, nomark, plain
  540.     }
  541. };
  542.  
  543. resource 'MENU' (mFile, preload) { /* enable Quit and Open only, program enables others */
  544.     mFile, textMenuProc,
  545.     (NoItems | MenuItem2 | MenuItem12),
  546.     enabled, "File",
  547.     {
  548.         "New",
  549.             noicon, "N", nomark, plain;
  550.         "Open…",
  551.             noicon, "O", nomark, plain;
  552.         "-",
  553.             noicon, nokey, nomark, plain;
  554.         "Close",
  555.             noicon, "W", nomark, plain;
  556.         "Save",
  557.             noicon, "S", nomark, plain;
  558.         "Save As…",
  559.             noicon, nokey, nomark, plain;
  560.         "Revert",
  561.             noicon, nokey, nomark, plain;
  562.         "-",
  563.             noicon, nokey, nomark, plain;
  564.         "Page Setup…",
  565.             noicon, nokey, nomark, plain;
  566.         "Print…",
  567.             noicon, nokey, nomark, plain;
  568.         "-",
  569.             noicon, nokey, nomark, plain;
  570.         "Quit",
  571.             noicon, "Q", nomark, plain
  572.     }
  573. };
  574.  
  575. resource 'MENU' (mEdit, preload) { /* disable everything, program does the enabling */
  576.     mEdit, textMenuProc,
  577.     NoItems,
  578.     enabled, "Edit",
  579.      {
  580.         "Undo",
  581.             noicon, "Z", nomark, plain;
  582.         "-",
  583.             noicon, nokey, nomark, plain;
  584.         "Cut",
  585.             noicon, "X", nomark, plain;
  586.         "Copy",
  587.             noicon, "C", nomark, plain;
  588.         "Paste",
  589.             noicon, "V", nomark, plain;
  590.         "Clear",
  591.             noicon, nokey, nomark, plain
  592.     }
  593. };
  594.  
  595. resource 'MENU' (mDemos, preload) { /* enable everything except the dashed lines */
  596.     mDemos, textMenuProc,
  597.     (AllItems & ~MenuItem4),
  598.     enabled, "Demos",
  599.      {
  600.         "Note Snth Scale",
  601.             noicon, nokey, nomark, plain;
  602.         "Note Snth Melody",
  603.             noicon, nokey, nomark, plain;
  604.         "Note Snth Timbres",
  605.             noicon, nokey, nomark, plain;
  606.         "-",
  607.             noicon, nokey, nomark, plain;
  608.         "Wave Snth Scale",
  609.             noicon, nokey, nomark, plain;
  610.         "Wave Snth Melody",
  611.             noicon, nokey, nomark, plain;
  612.         "Wave Snth Counterpoint",
  613.             noicon, nokey, nomark, plain
  614.     }
  615. };
  616.  
  617. /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  618.  The quintessential MultiFinder friendliness device, the SIZE resource */
  619.  
  620. resource 'SIZE' (-1, purgeable) {
  621.     dontSaveScreen,
  622.     acceptSuspendResumeEvents,
  623.     enableOptionSwitch,
  624.     canBackground,                    /* we can background, but we don’t */
  625.     multiFinderAware,                /* we do our own activate/deactivate */
  626.     backgroundAndForeground,    /* this is not a background-only application! */
  627.     dontGetFrontClicks,            /* standard, don’t want front clicks */
  628.     ignoreChildDiedEvents,        /* I’m not a debugger and I don’t sub-launch */
  629.     is32BitCompatible,            /* this is a 32 bit clean application */
  630.     reserved, reserved, reserved, reserved,
  631.     reserved, reserved, reserved,
  632.     kPrefSize * 1024,
  633.     kMinSize * 1024
  634. };
  635.  
  636. /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  637.  These are the resources used for the application’s about window.
  638.  The ICON is copied from the bundle resource’s ICN#.  The cicn is also
  639.  based on that. */
  640.  
  641. resource 'WIND' (rAboutWindow, purgeable) {
  642.     {0, 0, kAboutWindowSizeH, kAboutWindowSizeW}, altDBoxProc, visible, noGoAway, 0x0, ""
  643. };
  644.  
  645. resource 'CNTL' (rAboutOKCntl, purgeable) {
  646.     {
  647.     (kAboutWindowSizeH - kDafaultButSizeH),                                        /* top */
  648.     ((kAboutWindowSizeW - kDafaultButSizeW) / 2),                                /* left */
  649.     (kAboutWindowSizeH - kDafaultButSizeH + kButtonSizeH),                    /* bottom */
  650.     (((kAboutWindowSizeW - kDafaultButSizeW) / 2) + kDafaultButSizeW)        /* right */
  651.     },
  652.     0, visible, 0, 0, pushButProc, 0, "OK"
  653. };
  654.  
  655. resource 'STR ' (rAboutText, purgeable) {
  656.     "“^0” version ^1\n"
  657.     "A sample application using the Sound Manager.\n\n"
  658.     "Brought to you by Jim Reekes\n"
  659.     "Macintosh Developer Technical Support\n"
  660.     "Copyright © 1989-90 Apple Computer\n\n"
  661.     "We’d go Moof!™ for you, but Vince won’t let us."
  662. };
  663.  
  664. resource 'ICON' (rMoofIcon, purgeable) {
  665. /* [1] */
  666.         $"04 30 40 00 0A 50 A0 00 0B 91 10 02 08 22 08 03"
  667.         $"12 24 04 05 20 28 02 09 40 10 01 11 80 0C 00 A1"
  668.         $"80 03 FF C2 7E 00 FF 04 01 00 7F 04 03 00 1E 08"
  669.         $"04 E0 00 0C 08 E0 00 0A 10 E0 00 09 08 C0 00 06"
  670.         $"04 87 FE 04 02 88 01 04 01 88 00 84 00 88 00 44"
  671.         $"00 88 00 44 00 88 00 C4 01 10 01 88 02 28 03 10"
  672.         $"01 C4 04 E0 00 02 08 00 73 BF FB EE 4C A2 8A 2A"
  673.         $"40 AA AA EA 52 AA AA 24 5E A2 8A EA 73 BE FB 8E",
  674. };
  675.  
  676. resource 'cicn' (rMoofIcon, purgeable) {
  677.  
  678. #ifndef MPW32
  679.     16, {0, 0, 32, 32}, 0, unpacked, 0, 0x48, 0x48, chunky,
  680.     4, 1, 4, 0, 0, 4, {0, 0, 32, 32}, 4, {0, 0, 32, 32},
  681. #else
  682.     {0, 0, 32, 32}, 4,
  683. #endif
  684.  
  685.     $"0430 4000 0E70 E000 0FF1 F002 0FE3 F803"
  686.     $"1FE7 FC07 3FEF FE0F 7FFF FF1F FFFF FFBF"
  687.     $"FFFF FFFE 7FFF FFFC 01FF FFFC 03FF FFF8"
  688.     $"07FF FFFC 0FFF FFFE 1FFF FFFF 0FFF FFFE"
  689.     $"07FF FFFC 03FF FFFC 01FF FFFC 00FF FFFC"
  690.     $"00FF FFFC 00FF FFFC 01FF FFF8 03EF FFF0"
  691.     $"01C7 FCE0 0003 F800 73BF FBEE 7FBE FBEE"
  692.     $"7FBE FBEE 7FBE FBE4 7FBE FBEE 73BE FB8E",
  693.     $"0430 4000 0A50 A000 0B91 1002 0822 0803"
  694.     $"1224 0405 2028 0209 4010 0111 800C 00A1"
  695.     $"8003 FFC2 7E00 FF04 0100 7F04 0300 1E08"
  696.     $"04E0 000C 08E0 000A 10E0 0009 08C0 0006"
  697.     $"0487 FE04 0288 0104 0188 0084 0088 0044"
  698.     $"0088 0044 0088 00C4 0110 0188 0228 0310"
  699.     $"01C4 04E0 0002 0800 73BF FBEE 4CA2 8A2A"
  700.     $"40AA AAEA 52AA AA24 5EA2 8AEA 73BE FB8E",
  701. #ifndef MPW32
  702.     0x0,
  703.     0,
  704. #endif
  705.     {    /* array ColorSpec: 4 elements */
  706. /* [1] */ 0, 65535, 65535, 65535,
  707. /* [2] */ 1, 0, 0, 0,
  708. /* [3] */ 2, 5098, 49151, 9110,
  709. /* [4] */ 3, 65535, 5898, 5898
  710.     },
  711.     $"0000 0F00 00FF 0000 0F00 0000 0000 0000"
  712.     $"0000 F0F0 0F0F 0000 F2F0 0000 0000 0000"
  713.     $"0000 F0FF F00F 000F 222F 0000 0000 00F0"
  714.     $"0000 F000 00F0 00F2 2222 F000 0000 00FF"
  715.     $"000F 00F0 00F0 0F22 2222 2F00 0000 0F0F"
  716.     $"00F0 0000 00F0 F222 2222 22F0 0000 F00F"
  717.     $"0F00 0000 000F 2222 2222 222F 000F 000F"
  718.     $"F000 0000 0000 FF22 2222 2222 F0F0 000F"
  719.     $"F000 0000 0000 00FF FFFF FFFF FF00 00F0"
  720.     $"0FFF FFF0 0000 0000 FFFF FFFF 0000 0F00"
  721.     $"0000 000F 0000 0000 0FFF FFFF 0000 0F00"
  722.     $"0000 00FF 0000 0000 000F FFF0 0000 F000"
  723.     $"0000 0F22 FFF0 0000 0000 0000 0000 FF00"
  724.     $"0000 F222 FFF0 0000 0000 0000 0000 F200"
  725.     $"000F 2222 FFF0 0000 0000 0000 0000 F22F"
  726.     $"0000 F222 FF00 0000 0000 0000 0000 0FF0"
  727.     $"0000 0F22 F000 0FFF FFFF FFF0 0000 0F00"
  728.     $"0000 00F2 F000 F222 2222 222F 0000 0F00"
  729.     $"0000 000F F000 F222 2222 2222 F000 0F00"
  730.     $"0000 0000 F000 F222 2222 2222 2F00 0F00"
  731.     $"0000 0000 F000 F222 2222 2222 2F00 0F00"
  732.     $"0000 0000 F000 F222 2222 2222 FF00 0F00"
  733.     $"0000 000F 000F 2222 2222 222F F000 F000"
  734.     $"0000 00F0 00F0 F222 2222 22FF 000F 0000"
  735.     $"0000 000F FF00 0F22 2222 2F00 FFF0 0000"
  736.     $"0000 0000 0000 00F2 2222 F000 0000 0000"
  737.     $"0FFF 00FF F0FF FFFF FFFF F0FF FFF0 FFF0"
  738.     $"0F33 FF33 F0F3 33F0 F333 F0F3 33F0 F3F0"
  739.     $"0F33 3333 F0F3 F3F0 F3F3 F0F3 FFF0 F3F0"
  740.     $"0F3F 33F3 F0F3 F3F0 F3F3 F0F3 33F0 0F00"
  741.     $"0F3F FFF3 F0F3 33F0 F333 F0F3 FFF0 F3F0"
  742.     $"0FFF 00FF F0FF FFF0 FFFF F0FF F000 FFF0"
  743. };
  744.  
  745. resource 'PICT' (rAppPict, purgeable) {
  746.     3396, {110, 108, 151, 350},
  747.     $"0011 02FF 0C00 FFFF FFFF 006C 0000 006E 0000 015E 0000 0097 0000 0000 0000 001E"
  748.     $"0001 000A 006E 006C 0097 015E 0099 80FA 006E 006C 0097 0165 0000 0000 0000 0000"
  749.     $"0048 0000 0048 0000 0000 0008 0001 0008 0000 0000 0000 1F10 0000 0000 0000 0791"
  750.     $"8000 00FF 0800 FFFF FFFF FFFF 0800 FFFF FFFF CCCC 0800 FFFF FFFF 9999 0800 FFFF"
  751.     $"FFFF 6666 0800 FFFF FFFF 3333 0800 FFFF FFFF 0000 0800 FFFF CCCC FFFF 0800 FFFF"
  752.     $"CCCC CCCC 0800 FFFF CCCC 9999 0800 FFFF CCCC 6666 0800 FFFF CCCC 3333 0800 FFFF"
  753.     $"CCCC 0000 0800 FFFF 9999 FFFF 0800 FFFF 9999 CCCC 0800 FFFF 9999 9999 0800 FFFF"
  754.     $"9999 6666 0800 FFFF 9999 3333 0800 FFFF 9999 0000 0800 FFFF 6666 FFFF 0800 FFFF"
  755.     $"6666 CCCC 0800 FFFF 6666 9999 0800 FFFF 6666 6666 0800 FFFF 6666 3333 0800 FFFF"
  756.     $"6666 0000 0800 FFFF 3333 FFFF 0800 FFFF 3333 CCCC 0800 FFFF 3333 9999 0800 FFFF"
  757.     $"3333 6666 0800 FFFF 3333 3333 0800 FFFF 3333 0000 0800 FFFF 0000 FFFF 0800 FFFF"
  758.     $"0000 CCCC 0800 FFFF 0000 9999 0800 FFFF 0000 6666 0800 FFFF 0000 3333 0800 FFFF"
  759.     $"0000 0000 0800 CCCC FFFF FFFF 0800 CCCC FFFF CCCC 0800 CCCC FFFF 9999 0800 CCCC"
  760.     $"FFFF 6666 0800 CCCC FFFF 3333 0800 CCCC FFFF 0000 0800 CCCC CCCC FFFF 0800 CCCC"
  761.     $"CCCC CCCC 0800 CCCC CCCC 9999 0800 CCCC CCCC 6666 0800 CCCC CCCC 3333 0800 CCCC"
  762.     $"CCCC 0000 0800 CCCC 9999 FFFF 0800 CCCC 9999 CCCC 0800 CCCC 9999 9999 0800 CCCC"
  763.     $"9999 6666 0800 CCCC 9999 3333 0800 CCCC 9999 0000 0800 CCCC 6666 FFFF 0800 CCCC"
  764.     $"6666 CCCC 0800 CCCC 6666 9999 0800 CCCC 6666 6666 0800 CCCC 6666 3333 0800 CCCC"
  765.     $"6666 0000 0800 CCCC 3333 FFFF 0800 CCCC 3333 CCCC 0800 CCCC 3333 9999 0800 CCCC"
  766.     $"3333 6666 0800 CCCC 3333 3333 0800 CCCC 3333 0000 0800 CCCC 0000 FFFF 0800 CCCC"
  767.     $"0000 CCCC 0800 CCCC 0000 9999 0800 CCCC 0000 6666 0800 CCCC 0000 3333 0800 CCCC"
  768.     $"0000 0000 0800 9999 FFFF FFFF 0800 9999 FFFF CCCC 0800 9999 FFFF 9999 0800 9999"
  769.     $"FFFF 6666 0800 9999 FFFF 3333 0800 9999 FFFF 0000 0800 9999 CCCC FFFF 0800 9999"
  770.     $"CCCC CCCC 0800 9999 CCCC 9999 0800 9999 CCCC 6666 0800 9999 CCCC 3333 0800 9999"
  771.     $"CCCC 0000 0800 9999 9999 FFFF 0800 9999 9999 CCCC 0800 9999 9999 9999 0800 9999"
  772.     $"9999 6666 0800 9999 9999 3333 0800 9999 9999 0000 0800 9999 6666 FFFF 0800 9999"
  773.     $"6666 CCCC 0800 9999 6666 9999 0800 9999 6666 6666 0800 9999 6666 3333 0800 9999"
  774.     $"6666 0000 0800 9999 3333 FFFF 0800 9999 3333 CCCC 0800 9999 3333 9999 0800 9999"
  775.     $"3333 6666 0800 9999 3333 3333 0800 9999 3333 0000 0800 9999 0000 FFFF 0800 9999"
  776.     $"0000 CCCC 0800 9999 0000 9999 0800 9999 0000 6666 0800 9999 0000 3333 0800 9999"
  777.     $"0000 0000 0800 6666 FFFF FFFF 0800 6666 FFFF CCCC 0800 6666 FFFF 9999 0800 6666"
  778.     $"FFFF 6666 0800 6666 FFFF 3333 0800 6666 FFFF 0000 0800 6666 CCCC FFFF 0800 6666"
  779.     $"CCCC CCCC 0800 6666 CCCC 9999 0800 6666 CCCC 6666 0800 6666 CCCC 3333 0800 6666"
  780.     $"CCCC 0000 0800 6666 9999 FFFF 0800 6666 9999 CCCC 0800 6666 9999 9999 0800 6666"
  781.     $"9999 6666 0800 6666 9999 3333 0800 6666 9999 0000 0800 6666 6666 FFFF 0800 6666"
  782.     $"6666 CCCC 0800 6666 6666 9999 0800 6666 6666 6666 0800 6666 6666 3333 0800 6666"
  783.     $"6666 0000 0800 6666 3333 FFFF 0800 6666 3333 CCCC 0800 6666 3333 9999 0800 6666"
  784.     $"3333 6666 0800 6666 3333 3333 0800 6666 3333 0000 0800 6666 0000 FFFF 0800 6666"
  785.     $"0000 CCCC 0800 6666 0000 9999 0800 6666 0000 6666 0800 6666 0000 3333 0800 6666"
  786.     $"0000 0000 0800 3333 FFFF FFFF 0800 3333 FFFF CCCC 0800 3333 FFFF 9999 0800 3333"
  787.     $"FFFF 6666 0800 3333 FFFF 3333 0800 3333 FFFF 0000 0800 3333 CCCC FFFF 0800 3333"
  788.     $"CCCC CCCC 0800 3333 CCCC 9999 0800 3333 CCCC 6666 0800 3333 CCCC 3333 0800 3333"
  789.     $"CCCC 0000 0800 3333 9999 FFFF 0800 3333 9999 CCCC 0800 3333 9999 9999 0800 3333"
  790.     $"9999 6666 0800 3333 9999 3333 0800 3333 9999 0000 0800 3333 6666 FFFF 0800 3333"
  791.     $"6666 CCCC 0800 3333 6666 9999 0800 3333 6666 6666 0800 3333 6666 3333 0800 3333"
  792.     $"6666 0000 0800 3333 3333 FFFF 0800 3333 3333 CCCC 0800 3333 3333 9999 0800 3333"
  793.     $"3333 6666 0800 3333 3333 3333 0800 3333 3333 0000 0800 3333 0000 FFFF 0800 3333"
  794.     $"0000 CCCC 0800 3333 0000 9999 0800 3333 0000 6666 0800 3333 0000 3333 0800 3333"
  795.     $"0000 0000 0800 0000 FFFF FFFF 0800 0000 FFFF CCCC 0800 0000 FFFF 9999 0800 0000"
  796.     $"FFFF 6666 0800 0000 FFFF 3333 0800 0000 FFFF 0000 0800 0000 CCCC FFFF 0800 0000"
  797.     $"CCCC CCCC 0800 0000 CCCC 9999 0800 0000 CCCC 6666 0800 0000 CCCC 3333 0800 0000"
  798.     $"CCCC 0000 0800 0000 9999 FFFF 0800 0000 9999 CCCC 0800 0000 9999 9999 0800 0000"
  799.     $"9999 6666 0800 0000 9999 3333 0800 0000 9999 0000 0800 0000 6666 FFFF 0800 0000"
  800.     $"6666 CCCC 0800 0000 6666 9999 0800 0000 6666 6666 0800 0000 6666 3333 0800 0000"
  801.     $"6666 0000 0800 0000 3333 FFFF 0800 0000 3333 CCCC 0800 0000 3333 9999 0800 0000"
  802.     $"3333 6666 0800 0000 3333 3333 0800 0000 3333 0000 0800 0000 0000 FFFF 0800 0000"
  803.     $"0000 CCCC 0800 0000 0000 9999 0800 0000 0000 6666 0800 0000 0000 3333 0800 EEEE"
  804.     $"0000 0000 0800 DDDD 0000 0000 0800 BBBB 0000 0000 0800 AAAA 0000 0000 0800 8888"
  805.     $"0000 0000 0800 7777 0000 0000 0800 5555 0000 0000 0800 4444 0000 0000 0800 2222"
  806.     $"0000 0000 0800 1111 0000 0000 0800 0000 EEEE 0000 0800 0000 DDDD 0000 0800 0000"
  807.     $"BBBB 0000 0800 0000 AAAA 0000 0800 0000 8888 0000 2000 AAAA AAAA AAAA 2000 DDDD"
  808.     $"DDDD DDDD 2000 0000 0000 1111 2000 0000 0000 4444 2000 0000 0000 7777 2000 0000"
  809.     $"0000 AAAA 2000 0000 0000 DDDD 2000 0000 1111 0000 2000 0000 4444 0000 2000 0003"
  810.     $"D0D7 0001 2000 1111 1111 1111 2000 2222 2222 2222 2000 4444 4444 4444 2000 5555"
  811.     $"5555 5555 2000 7777 7777 7777 2000 8888 8888 8888 2000 BBBB BBBB BBBB 2000 EEEE"
  812.     $"EEEE EEEE 2000 0000 0000 2222 2000 0000 0000 5555 2000 0000 0000 8888 2000 0000"
  813.     $"0000 BBBB 2000 0000 0000 EEEE 2000 0000 2222 0000 2000 0000 5555 0000 0800 0000"
  814.     $"0000 0000 006E 006C 0097 015E 006E 006C 0097 015E 0000 000A 006E 006C 0097 015E"
  815.     $"0481 0087 0004 8100 8700 0481 0087 0004 8100 8700 08F9 0081 FF9E FFF2 000C F900"
  816.     $"00FF 81EF A0EF 00FF F200 0CF9 0000 FF81 EFA0 EF00 FFF2 000C F900 00FF 81EF A0EF"
  817.     $"00FF F200 0FF9 0000 FF8B EF01 0000 98EF 00FF F200 17F9 0000 FFD5 EF01 0000 BBEF"
  818.     $"FD00 F1EF FE00 ABEF 00FF F200 16F9 0000 FFDD EFF8 00B9 EFFD 00F1 EFFE 00AC EF00"
  819.     $"FFF2 001A F900 00FF DEEF FD00 FEEF FE00 B9EF FD00 F1EF FD00 ADEF 00FF F200 1BF9"
  820.     $"0000 FFE0 EFFC 00FD EF01 0000 B8EF FD00 F1EF FC00 AEEF 00FF F200 36F9 0000 FFE1"
  821.     $"EFFC 00FD EFFE 00F7 EFFB 00F7 EFFD 00FE EFFC 00F7 EF02 0000 EFFC 00F5 EFF8 00F1"
  822.     $"EFFB 00F4 EFF9 00F5 EFF9 00D8 EF00 FFF2 0037 F900 00FF E3EF FB00 F2EF F700 F9EF"
  823.     $"FD00 FDEF FD00 F8EF F700 F7EF FD00 01EF EFFC 00F1 EFFB 00F5 EFF5 00F8 EFFD 0000"
  824.     $"EFFB 00DB EF00 FFF2 0047 F900 00FF E3EF FC00 F3EF FD00 FEEF FD00 F9EF FC00 FEEF"
  825.     $"FC00 F9EF FC00 01EF EFFC 00F9 EFFC 00FE EFFC 00F2 EF02 0000 EFFD 00F6 EFFD 00FD"
  826.     $"EFFD 00F9 EFFC 00FE EFFC 00DC EF00 FFF2 0047 F900 00FF E3EF FA00 F6EF FD00 FDEF"
  827.     $"FD00 F9EF FD00 FDEF FD00 F8EF FD00 FDEF FD00 F9EF FD00 FDEF FC00 F2EF 0300 00EF"
  828.     $"EFFD 00F7 EFFC 00FD EFFC 00FA EFFC 00FE EFFB 00DE EF00 FFF2 0047 F900 00FF E2EF"
  829.     $"FA00 F8EF FD00 FDEF FC00 FAEF FC00 FEEF FC00 F8EF FD00 FDEF FD00 F9EF FD00 FCEF"
  830.     $"FD00 F2EF 0100 00FE EFFD 00F6 EFFD 00FC EFFC 00FB EFFC 00FC EFFC 00E0 EF00 FFF2"
  831.     $"0046 F900 00FF E2EF FA00 F9EF FD00 FDEF FC00 FAEF FC00 FDEF FD00 F8EF FC00 FEEF"
  832.     $"FC00 F9EF FD00 FCEF FD00 F2EF FE00 FEEF FD00 F7EF FC00 FCEF FD00 FAEF FC00 FCEF"
  833.     $"FC00 E1EF 00FF F200 42F9 0000 FFE1 EFFC 00F9 EFFD 00FC EFFC 00FA EFFC 00FE EFFC"
  834.     $"00F8 EFFD 00FD EFFC 00F9 EFFD 00FC EFFD 00F2 EFF6 00F7 EFFD 00FC EFFC 00FA EFFC"
  835.     $"00FC EFFC 00E2 EF00 FFF2 004B F900 00FF E9EF 0100 00FB EFFC 00FA EFFD 00FC EFFC"
  836.     $"00FA EFFC 00FD EFFC 00F8 EFFD 00FD EFFC 00F9 EFFD 00FC EFFC 00F3 EFFE 00FC EFFD"
  837.     $"00F8 EFFC 00FC EFFC 00FA EFFC 00FC EFFC 00E3 EF00 FFF2 004B F900 00FF EAEF 0100"
  838.     $"00FB EFFC 00FA EFFC 00FD EFFC 00F9 EFFC 00FD EFFD 00F7 EFFD 00FD EFFC 00F9 EFFC"
  839.     $"00FD EFFC 00F3 EFFE 00FB EFFD 00F8 EFFC 00FC EFFD 00F9 EFFB 00FD EFFC 00E4 EF00"
  840.     $"FFF2 004B F900 00FF ECEF FD00 FCEF FD00 F8EF FD00 FDEF FD00 F8EF FB00 01EF EFFB"
  841.     $"00F8 EFFC 00FD EFFC 00F9 EFFC 00FD EFFC 00F3 EFFE 00FA EFFD 00F8 EFFC 00FD EFFC"
  842.     $"00F9 EFFB 00FE EFFC 00E4 EF00 FFF2 0040 F900 00FF EDEF FD00 FDEF FC00 F7EF F700"
  843.     $"F5EF F400 F9EF FB00 FEEF FC00 F7EF F200 F5EF FE00 FAEF FB00 FAEF FA00 01EF EFFD"
  844.     $"00F7 EFFA 0001 EFEF FD00 E4EF 00FF F200 3BF9 0000 FFEB EFF8 00F4 EFFA 00F2 EFFC"
  845.     $"0000 EFF9 00FB EFFA 0000 EFF9 00F7 EFFB 0001 EFEF FE00 F3EF FC00 FDEF F800 FBEF"
  846.     $"F700 F4EF F600 E3EF 00FF F200 14F9 0000 FF81 EFDF EFFB 00EF EFFC 00DF EF00 FFF2"
  847.     $"0014 F900 00FF 81EF DEEF FC00 EEEF FC00 E0EF 00FF F200 14F9 0000 FF81 EFDE EFFB"
  848.     $"00EE EFFC 00E1 EF00 FFF2 0014 F900 00FF 81EF DDEF FC00 EDEF FC00 E2EF 00FF F200"
  849.     $"14F9 0000 FF81 EFDC EFFB 00EE EFFB 00E4 EF00 FFF2 0014 F900 00FF 81EF DBEF FA00"
  850.     $"EFEF FA00 E6EF 00FF F200 0CF9 0000 FF81 EFA0 EF00 FFF2 000C F900 00FF 81EF A0EF"
  851.     $"00FF F200 0CF9 0000 FF81 EFA0 EF00 FFF2 0008 F900 81FF 9EFF F200 0481 0087 0004"
  852.     $"8100 8700 0481 0087 0004 8100 8700 0481 0087 0004 8100 8700 00FF"
  853. };
  854.  
  855.  
  856. /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  857.  These are the resources used used for the sound status window. */
  858.  
  859. resource 'WIND' (rStatusWindow, purgeable) {
  860.     {0, 0, kStatusWindowSizeH, kStatusWindowSizeW}, documentProc, invisible, noGoAway, 0x0, "Sound Status"
  861. };
  862.  
  863. resource 'CNTL' (rCancelCntl, purgeable) {
  864.     {
  865.     (kStatusWindowSizeH - kDafaultButSizeH),                                        /* top */
  866.     ((kStatusWindowSizeW - kDafaultButSizeW) / 2),                                /* left */
  867.     (kStatusWindowSizeH - kDafaultButSizeH + kButtonSizeH),                    /* bottom */
  868.     (((kStatusWindowSizeW - kDafaultButSizeW) / 2) + kDafaultButSizeW)    /* right */
  869.     },
  870.     0, visible, 0, 0, pushButProc, 0, "Stop"
  871. };
  872.  
  873. resource 'STR#' (sMessStrings, purgeable) {
  874.     {
  875.     "Playing the sound asynchronously.";
  876.     "Playing the sound asynchronously resampled to middle C.";
  877.     "Playing a C major scale.";
  878.     "Playing “Promenade” from\n Pictures At An Exhibition,\n by Mussorgsky.";
  879.     "Playing middle C with the various timbres.";
  880.     "Playing “Schaut, ihr Sünder”\n by Löwenstern,\n arranged by JS Bach.";
  881.     }
  882. };
  883.  
  884. /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  885.  These are the resources used for the sound document window.  This includes
  886.  a string resource that is the name given to an untitled sound resource
  887.  to appear in the list. */
  888.  
  889. resource 'WIND' (rSoundWindow, purgeable) {
  890.     {0, 0, kSoundWindowSizeH, kSoundWindowSizeW}, documentProc, invisible, goAway, 0x0, ""
  891. };
  892.  
  893. /* This rectangle is the position of the list in the document window.  The rectangle
  894.    is the size of the WIND inset by kSndStdSpacing and to the left of the buttons. */
  895. resource 'RECT' (rListRectID, purgeable) {
  896.     {
  897.     kSndStdSpacing,
  898.     kSndStdSpacing,
  899.     (kSoundWindowSizeH - kSndStdSpacing),
  900.     (kSoundWindowSizeW - kSndButtonSizeW - kSndStdSpacing - kSndListButGap)}
  901. };
  902.  
  903. resource 'CNTL' (rPlaySndCntl, purgeable) {
  904. /* [1] */ {
  905.     ((1 * kSndStdSpacing) + (1 * kSndButtonSizeH) - kSndButtonSizeH),    /* top */
  906.     (kSoundWindowSizeW - kSndButtonSizeW - kSndStdSpacing),                /* left */
  907.     ((1 * kSndStdSpacing) + (1 * kSndButtonSizeH)),                            /* bottom */
  908.     (kSoundWindowSizeW - kSndStdSpacing)                                        /* right */
  909.     },
  910.     0, visible, 0, 0, pushButProcUseWFont, 0, "Play Sound"
  911. };
  912.  
  913. resource 'CNTL' (rHyperPlayCntl, purgeable) {
  914. /* [2] */ {
  915.     ((2 * kSndStdSpacing) + (2 * kSndButtonSizeH) - kSndButtonSizeH),    /* top */
  916.     (kSoundWindowSizeW - kSndButtonSizeW - kSndStdSpacing),                /* left */
  917.     ((2 * kSndStdSpacing) + (2 * kSndButtonSizeH)),                            /* bottom */
  918.     (kSoundWindowSizeW - kSndStdSpacing)                                        /* right */
  919.     },
  920.     0, visible, 0, 0, pushButProcUseWFont, 0, "Hyper Play"
  921. };
  922.  
  923. resource 'CNTL' (rPlayScaleCntl, purgeable) {
  924. /* [3] */ {
  925.     ((3 * kSndStdSpacing) + (3 * kSndButtonSizeH) - kSndButtonSizeH),    /* top */
  926.     (kSoundWindowSizeW - kSndButtonSizeW - kSndStdSpacing),                /* left */
  927.     ((3 * kSndStdSpacing) + (3 * kSndButtonSizeH)),                            /* bottom */
  928.     (kSoundWindowSizeW - kSndStdSpacing)                                        /* right */
  929.     },
  930.     0, visible, 0, 0, pushButProcUseWFont, 0, "Play Scale"
  931. };
  932.  
  933. resource 'CNTL' (rPlayMelodyCntl, purgeable) {
  934. /* [4] */ {
  935.     ((4 * kSndStdSpacing) + (4 * kSndButtonSizeH) - kSndButtonSizeH),    /* top */
  936.     (kSoundWindowSizeW - kSndButtonSizeW - kSndStdSpacing),                /* left */
  937.     ((4 * kSndStdSpacing) + (4 * kSndButtonSizeH)),                            /* bottom */
  938.     (kSoundWindowSizeW - kSndStdSpacing)                                        /* right */
  939.     },
  940.     0, visible, 0, 0, pushButProcUseWFont, 0, "Play Melody"
  941. };
  942.  
  943. resource 'CNTL' (rStopCntl, purgeable) {
  944. /* [5] */ {
  945.     ((5 * kSndStdSpacing) + (5 * kSndButtonSizeH) - kSndButtonSizeH),    /* top */
  946.     (kSoundWindowSizeW - kSndButtonSizeW - kSndStdSpacing),                /* left */
  947.     ((5 * kSndStdSpacing) + (5 * kSndButtonSizeH)),                            /* bottom */
  948.     (kSoundWindowSizeW - kSndStdSpacing)                                        /* right */
  949.     },
  950.     0, visible, 0, 0, pushButProcUseWFont, 0, "Stop Sound"
  951. };
  952.  
  953. resource 'STR ' (rUntitled, purgeable) {
  954.     "<untitled>"
  955. };
  956.  
  957.  
  958.